#! /bin/bash
#mysql_to_hdfs_inc_init.sh all/表名
#1、判断参数是否传入
if [ $# -lt 1 ]
then
	echo "必须传入all/表名..."
	exit
fi
#2、根据参数匹配首日加载
case $1 in
"all")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table consultation --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table payment --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table prescription --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table prescription_detail --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table patient --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table doctor --config /opt/module/maxwell/config.properties
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table user --config /opt/module/maxwell/config.properties
;;
"consultation")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table consultation --config /opt/module/maxwell/config.properties
;;
"payment")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table payment --config /opt/module/maxwell/config.properties
;;
"prescription")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table prescription --config /opt/module/maxwell/config.properties
;;
"prescription_detail")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table prescription_detail --config /opt/module/maxwell/config.properties
;;
"patient")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table patient --config /opt/module/maxwell/config.properties
;;
"doctor")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table doctor --config /opt/module/maxwell/config.properties
;;
"user")
	/opt/module/maxwell/bin/maxwell-bootstrap --database medical --table user --config /opt/module/maxwell/config.properties
;;
*)
	echo "表名输入错误..."
;;
esac
